package cn._2dland.tools;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class SinaServlet extends HttpServlet {
	private static final String SINA_URL = "http://v.iask.com/v_play.php?vid=";

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String vid = req.getParameter("vid");
		if(vid == null) vid = "1";
		String url = SINA_URL + vid;
		resp.setHeader("Location", url);
		resp.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
	}
}
